added samples
[windows-sources.git] / sdk / samples / all in on code / Visual Studio 2010 / VBEFLazyLoading / LazyLoading.Designer.vb
blob10d5eb7f2bbe6b9fe02e47888e0837b12e841d01
1 
2 '------------------------------------------------------------------------------
3 ' <auto-generated>
4 ' This code was generated from a template.
6 ' Manual changes to this file may cause unexpected behavior in your application.
7 ' Manual changes to this file will be overwritten if the code is regenerated.
8 ' </auto-generated>
9 '------------------------------------------------------------------------------
11 Imports System
12 Imports System.Data.Objects
13 Imports System.Data.Objects.DataClasses
14 Imports System.Data.EntityClient
15 Imports System.ComponentModel
16 Imports System.Xml.Serialization
17 Imports System.Runtime.Serialization
19 <Assembly: EdmSchemaAttribute("38eede33-590f-437d-997f-344016fd7bd4")>
20 #Region "EDM Relationship Metadata"
21 <Assembly: EdmRelationshipAttribute("LazyLoadingModel", "FK_Course_Department", "Department", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, GetType(Department), "Course", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, GetType(Course), True)>
23 #End Region
25 #Region "Contexts"
27 ''' <summary>
28 ''' No Metadata Documentation available.
29 ''' </summary>
30 Public Partial Class LazyLoadingEntities
31 Inherits ObjectContext
33 #Region "Constructors"
35 ''' <summary>
36 ''' Initializes a new LazyLoadingEntities object using the connection string found in the 'LazyLoadingEntities' section of the application configuration file.
37 ''' </summary>
38 Public Sub New()
39 MyBase.New("name=LazyLoadingEntities", "LazyLoadingEntities")
40 MyBase.ContextOptions.LazyLoadingEnabled = true
41 OnContextCreated()
42 End Sub
44 ''' <summary>
45 ''' Initialize a new LazyLoadingEntities object.
46 ''' </summary>
47 Public Sub New(ByVal connectionString As String)
48 MyBase.New(connectionString, "LazyLoadingEntities")
49 MyBase.ContextOptions.LazyLoadingEnabled = true
50 OnContextCreated()
51 End Sub
53 ''' <summary>
54 ''' Initialize a new LazyLoadingEntities object.
55 ''' </summary>
56 Public Sub New(ByVal connection As EntityConnection)
57 MyBase.New(connection, "LazyLoadingEntities")
58 MyBase.ContextOptions.LazyLoadingEnabled = true
59 OnContextCreated()
60 End Sub
62 #End Region
64 #Region "Partial Methods"
66 Partial Private Sub OnContextCreated()
67 End Sub
69 #End Region
71 #Region "ObjectSet Properties"
73 ''' <summary>
74 ''' No Metadata Documentation available.
75 ''' </summary>
76 Public ReadOnly Property Courses() As ObjectSet(Of Course)
77 Get
78 If (_Courses Is Nothing) Then
79 _Courses = MyBase.CreateObjectSet(Of Course)("Courses")
80 End If
81 Return _Courses
82 End Get
83 End Property
85 Private _Courses As ObjectSet(Of Course)
87 ''' <summary>
88 ''' No Metadata Documentation available.
89 ''' </summary>
90 Public ReadOnly Property Departments() As ObjectSet(Of Department)
91 Get
92 If (_Departments Is Nothing) Then
93 _Departments = MyBase.CreateObjectSet(Of Department)("Departments")
94 End If
95 Return _Departments
96 End Get
97 End Property
99 Private _Departments As ObjectSet(Of Department)
101 #End Region
102 #Region "AddTo Methods"
104 ''' <summary>
105 ''' Deprecated Method for adding a new object to the Courses EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
106 ''' </summary>
107 Public Sub AddToCourses(ByVal course As Course)
108 MyBase.AddObject("Courses", course)
109 End Sub
111 ''' <summary>
112 ''' Deprecated Method for adding a new object to the Departments EntitySet. Consider using the .Add method of the associated ObjectSet(Of T) property instead.
113 ''' </summary>
114 Public Sub AddToDepartments(ByVal department As Department)
115 MyBase.AddObject("Departments", department)
116 End Sub
118 #End Region
119 End Class
121 #End Region
122 #Region "Entities"
124 ''' <summary>
125 ''' No Metadata Documentation available.
126 ''' </summary>
127 <EdmEntityTypeAttribute(NamespaceName:="LazyLoadingModel", Name:="Course")>
128 <Serializable()>
129 <DataContractAttribute(IsReference:=True)>
130 Public Partial Class Course
131 Inherits EntityObject
132 #Region "Factory Method"
134 ''' <summary>
135 ''' Create a new Course object.
136 ''' </summary>
137 ''' <param name="courseID">Initial value of the CourseID property.</param>
138 Public Shared Function CreateCourse(courseID As Global.System.Int32) As Course
139 Dim course as Course = New Course
140 course.CourseID = courseID
141 Return course
142 End Function
144 #End Region
145 #Region "Primitive Properties"
147 ''' <summary>
148 ''' No Metadata Documentation available.
149 ''' </summary>
150 <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
151 <DataMemberAttribute()>
152 Public Property CourseID() As Global.System.Int32
154 Return _CourseID
155 End Get
157 If (_CourseID <> Value) Then
158 OnCourseIDChanging(value)
159 ReportPropertyChanging("CourseID")
160 _CourseID = StructuralObject.SetValidValue(value)
161 ReportPropertyChanged("CourseID")
162 OnCourseIDChanged()
163 End If
164 End Set
165 End Property
167 Private _CourseID As Global.System.Int32
168 Private Partial Sub OnCourseIDChanging(value As Global.System.Int32)
169 End Sub
171 Private Partial Sub OnCourseIDChanged()
172 End Sub
174 ''' <summary>
175 ''' No Metadata Documentation available.
176 ''' </summary>
177 <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
178 <DataMemberAttribute()>
179 Public Property Title() As Global.System.String
181 Return _Title
182 End Get
184 OnTitleChanging(value)
185 ReportPropertyChanging("Title")
186 _Title = StructuralObject.SetValidValue(value, true)
187 ReportPropertyChanged("Title")
188 OnTitleChanged()
189 End Set
190 End Property
192 Private _Title As Global.System.String
193 Private Partial Sub OnTitleChanging(value As Global.System.String)
194 End Sub
196 Private Partial Sub OnTitleChanged()
197 End Sub
199 ''' <summary>
200 ''' No Metadata Documentation available.
201 ''' </summary>
202 <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
203 <DataMemberAttribute()>
204 Public Property Credits() As Nullable(Of Global.System.Int32)
206 Return _Credits
207 End Get
209 OnCreditsChanging(value)
210 ReportPropertyChanging("Credits")
211 _Credits = StructuralObject.SetValidValue(value)
212 ReportPropertyChanged("Credits")
213 OnCreditsChanged()
214 End Set
215 End Property
217 Private _Credits As Nullable(Of Global.System.Int32)
218 Private Partial Sub OnCreditsChanging(value As Nullable(Of Global.System.Int32))
219 End Sub
221 Private Partial Sub OnCreditsChanged()
222 End Sub
224 ''' <summary>
225 ''' No Metadata Documentation available.
226 ''' </summary>
227 <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
228 <DataMemberAttribute()>
229 Public Property DepartmentID() As Nullable(Of Global.System.Int32)
231 Return _DepartmentID
232 End Get
234 OnDepartmentIDChanging(value)
235 ReportPropertyChanging("DepartmentID")
236 _DepartmentID = StructuralObject.SetValidValue(value)
237 ReportPropertyChanged("DepartmentID")
238 OnDepartmentIDChanged()
239 End Set
240 End Property
242 Private _DepartmentID As Nullable(Of Global.System.Int32)
243 Private Partial Sub OnDepartmentIDChanging(value As Nullable(Of Global.System.Int32))
244 End Sub
246 Private Partial Sub OnDepartmentIDChanged()
247 End Sub
249 ''' <summary>
250 ''' No Metadata Documentation available.
251 ''' </summary>
252 <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
253 <DataMemberAttribute()>
254 Public Property StatusID() As Nullable(Of Global.System.Boolean)
256 Return _StatusID
257 End Get
259 OnStatusIDChanging(value)
260 ReportPropertyChanging("StatusID")
261 _StatusID = StructuralObject.SetValidValue(value)
262 ReportPropertyChanged("StatusID")
263 OnStatusIDChanged()
264 End Set
265 End Property
267 Private _StatusID As Nullable(Of Global.System.Boolean)
268 Private Partial Sub OnStatusIDChanging(value As Nullable(Of Global.System.Boolean))
269 End Sub
271 Private Partial Sub OnStatusIDChanged()
272 End Sub
274 #End Region
275 #Region "Navigation Properties"
277 ''' <summary>
278 ''' No Metadata Documentation available.
279 ''' </summary>
280 <XmlIgnoreAttribute()>
281 <SoapIgnoreAttribute()>
282 <DataMemberAttribute()>
283 <EdmRelationshipNavigationPropertyAttribute("LazyLoadingModel", "FK_Course_Department", "Department")>
284 Public Property Department() As Department
286 Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Department)("LazyLoadingModel.FK_Course_Department", "Department").Value
287 End Get
289 CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Department)("LazyLoadingModel.FK_Course_Department", "Department").Value = value
290 End Set
291 End Property
292 ''' <summary>
293 ''' No Metadata Documentation available.
294 ''' </summary>
295 <BrowsableAttribute(False)>
296 <DataMemberAttribute()>
297 Public Property DepartmentReference() As EntityReference(Of Department)
299 Return CType(Me, IEntityWithRelationships).RelationshipManager.GetRelatedReference(Of Department)("LazyLoadingModel.FK_Course_Department", "Department")
300 End Get
302 If (Not value Is Nothing)
303 CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedReference(Of Department)("LazyLoadingModel.FK_Course_Department", "Department", value)
304 End If
305 End Set
306 End Property
308 #End Region
309 End Class
311 ''' <summary>
312 ''' No Metadata Documentation available.
313 ''' </summary>
314 <EdmEntityTypeAttribute(NamespaceName:="LazyLoadingModel", Name:="Department")>
315 <Serializable()>
316 <DataContractAttribute(IsReference:=True)>
317 Public Partial Class Department
318 Inherits EntityObject
319 #Region "Factory Method"
321 ''' <summary>
322 ''' Create a new Department object.
323 ''' </summary>
324 ''' <param name="departmentID">Initial value of the DepartmentID property.</param>
325 Public Shared Function CreateDepartment(departmentID As Global.System.Int32) As Department
326 Dim department as Department = New Department
327 department.DepartmentID = departmentID
328 Return department
329 End Function
331 #End Region
332 #Region "Primitive Properties"
334 ''' <summary>
335 ''' No Metadata Documentation available.
336 ''' </summary>
337 <EdmScalarPropertyAttribute(EntityKeyProperty:=true, IsNullable:=false)>
338 <DataMemberAttribute()>
339 Public Property DepartmentID() As Global.System.Int32
341 Return _DepartmentID
342 End Get
344 If (_DepartmentID <> Value) Then
345 OnDepartmentIDChanging(value)
346 ReportPropertyChanging("DepartmentID")
347 _DepartmentID = StructuralObject.SetValidValue(value)
348 ReportPropertyChanged("DepartmentID")
349 OnDepartmentIDChanged()
350 End If
351 End Set
352 End Property
354 Private _DepartmentID As Global.System.Int32
355 Private Partial Sub OnDepartmentIDChanging(value As Global.System.Int32)
356 End Sub
358 Private Partial Sub OnDepartmentIDChanged()
359 End Sub
361 ''' <summary>
362 ''' No Metadata Documentation available.
363 ''' </summary>
364 <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
365 <DataMemberAttribute()>
366 Public Property Name() As Global.System.String
368 Return _Name
369 End Get
371 OnNameChanging(value)
372 ReportPropertyChanging("Name")
373 _Name = StructuralObject.SetValidValue(value, true)
374 ReportPropertyChanged("Name")
375 OnNameChanged()
376 End Set
377 End Property
379 Private _Name As Global.System.String
380 Private Partial Sub OnNameChanging(value As Global.System.String)
381 End Sub
383 Private Partial Sub OnNameChanged()
384 End Sub
386 ''' <summary>
387 ''' No Metadata Documentation available.
388 ''' </summary>
389 <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
390 <DataMemberAttribute()>
391 Public Property Budget() As Nullable(Of Global.System.Decimal)
393 Return _Budget
394 End Get
396 OnBudgetChanging(value)
397 ReportPropertyChanging("Budget")
398 _Budget = StructuralObject.SetValidValue(value)
399 ReportPropertyChanged("Budget")
400 OnBudgetChanged()
401 End Set
402 End Property
404 Private _Budget As Nullable(Of Global.System.Decimal)
405 Private Partial Sub OnBudgetChanging(value As Nullable(Of Global.System.Decimal))
406 End Sub
408 Private Partial Sub OnBudgetChanged()
409 End Sub
411 ''' <summary>
412 ''' No Metadata Documentation available.
413 ''' </summary>
414 <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
415 <DataMemberAttribute()>
416 Public Property StartDate() As Nullable(Of Global.System.DateTime)
418 Return _StartDate
419 End Get
421 OnStartDateChanging(value)
422 ReportPropertyChanging("StartDate")
423 _StartDate = StructuralObject.SetValidValue(value)
424 ReportPropertyChanged("StartDate")
425 OnStartDateChanged()
426 End Set
427 End Property
429 Private _StartDate As Nullable(Of Global.System.DateTime)
430 Private Partial Sub OnStartDateChanging(value As Nullable(Of Global.System.DateTime))
431 End Sub
433 Private Partial Sub OnStartDateChanged()
434 End Sub
436 ''' <summary>
437 ''' No Metadata Documentation available.
438 ''' </summary>
439 <EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)>
440 <DataMemberAttribute()>
441 Public Property Administrator() As Nullable(Of Global.System.Int32)
443 Return _Administrator
444 End Get
446 OnAdministratorChanging(value)
447 ReportPropertyChanging("Administrator")
448 _Administrator = StructuralObject.SetValidValue(value)
449 ReportPropertyChanged("Administrator")
450 OnAdministratorChanged()
451 End Set
452 End Property
454 Private _Administrator As Nullable(Of Global.System.Int32)
455 Private Partial Sub OnAdministratorChanging(value As Nullable(Of Global.System.Int32))
456 End Sub
458 Private Partial Sub OnAdministratorChanged()
459 End Sub
461 #End Region
462 #Region "Navigation Properties"
464 ''' <summary>
465 ''' No Metadata Documentation available.
466 ''' </summary>
467 <XmlIgnoreAttribute()>
468 <SoapIgnoreAttribute()>
469 <DataMemberAttribute()>
470 <EdmRelationshipNavigationPropertyAttribute("LazyLoadingModel", "FK_Course_Department", "Course")>
471 Public Property Courses() As EntityCollection(Of Course)
473 Return CType(Me,IEntityWithRelationships).RelationshipManager.GetRelatedCollection(Of Course)("LazyLoadingModel.FK_Course_Department", "Course")
474 End Get
476 If (Not value Is Nothing)
477 CType(Me, IEntityWithRelationships).RelationshipManager.InitializeRelatedCollection(Of Course)("LazyLoadingModel.FK_Course_Department", "Course", value)
478 End If
479 End Set
480 End Property
482 #End Region
483 End Class
485 #End Region